<template>
  <div>
    <div class="nav">
      <van-swipe :autoplay="3000" indicator-color="white">
        <van-swipe-item v-for="(image, index) in images" :key="index">
          <img class="img" v-lazy="image" />
        </van-swipe-item>
      </van-swipe>

      <!-- 搜索 -->
      <div class="search"   @click="$router.push('/city')">
        <van-search
          v-model="value"
          show-action
          label="上海"
          placeholder="请输入小区或地址"
        >
          <template #action>
            <div @click="$router.push('/map')"><van-icon name="map-marked" /></div>
          </template>
        </van-search>
      </div>
    </div>
    <!--搜索  -->

    <!-- 功能跳转 -->
    <div class="iconcolor">
      <van-grid :border="false">
        <van-grid-item icon="wap-home-o" to="/find" text="整租" />
        <van-grid-item icon="friends-o" to="/find" text="合租" />
        <van-grid-item icon="location-o" to="/map" text="地图找房" />
        <van-grid-item icon="cash-back-record" to="/gorent" text="去出租" />
      </van-grid>
    </div>
    <!-- 功能跳转 -->

    <!-- 租房小组 -->
    <div class="nav_bar">
      <div class="nav_bar_head">
        <span class="sp1">租房小组</span>
        <span class="sp2">更多</span>
      </div>
      <div class="nav_bar_main">
        <div class="maintext">
          <img src="http://115.159.87.220:8080/img/groups/1.png" alt="" />

          <p>家住回龙观归属的感觉</p>
        </div>
        <div class="maintext">
          <img src="http://115.159.87.220:8080/img/groups/2.png" alt="" />

          <p>宜居四五环大都市生活</p>
        </div>
        <div class="maintext">
          <img src="http://115.159.87.220:8080/img/groups/3.png" alt="" />

          <p>喧嚣三里屯繁华的背后</p>
        </div>
        <div class="maintext">
          <img src="http://115.159.87.220:8080/img/groups/4.png" alt="" />

          <p>比邻十号线地铁心连心</p>
        </div>
      </div>
    </div>
  </div>
</template>

<script>
export default {
  data () {
    return {
      value: '',
      images: [
        'http://liufusong.top:8080/img/swiper/1.png',
        'http://liufusong.top:8080/img/swiper/2.png',
        'http://liufusong.top:8080/img/swiper/3.png'
      ]
    }
  }
}
</script>

<style lang="less" scoped>
.img {
  width: 380px;
  height: 210px;
}
.nav {
  position: relative;
}
.van-search {
  position: absolute;
  top: 0;
  width: 330px;
  height: 35px;
  margin-top: 20px;
  margin-left: 20px;
}
.iconcolor {
  color: #5bb27c;
}
.nav_bar {
  width: 375px;
  height: 180px;
  background-color: #f6f5f6;
  .nav_bar_head {
    display: flex;
    justify-content: space-between;
    margin: 0px 10px;
    padding-top: 15px;
    .sp1 {
      font-size: 15px;
      font-weight: bold;
    }
    .sp2 {
      font-size: 14px;
      font-weight: 400;
      color: #787d82;
    }
  }
  .nav_bar_main {
    margin-top: 10px;
    width: 370px;
    height: 130px;
    display: flex;
    justify-content: space-around;
    flex-wrap: wrap;
    .maintext {
      width: 180px;
      height: 60px;
      background-color: #fff;
      display: flex;
      justify-content: space-around;
      img {
        width: 50px;
        height: 50px;
        margin: 5px;
      }
      p {
        display: inline-block;
        width: 70px;
        height: 40px;
        font-size: 12px;
        margin-right: 20px;
      }
    }
  }
}
    .van-search__label{
    line-height: 9vw;
    font-size: 13px;
  }
  .van-search__content{
    background-color: #fff;
    font-size: 14px;
  }
</style>
